const {defineConfig} = require('@vue/cli-service')
let webpack = require('webpack')

const AutoImport = require('unplugin-auto-import/webpack');
const Components = require('unplugin-vue-components/webpack');
const { ElementPlusResolver } = require('unplugin-vue-components/resolvers');
module.exports = defineConfig({
    transpileDependencies: true,
    lintOnSave: false,   //关闭eslint校验
    configureWebpack: {
        // disable performance hints
        performance: {
            hints: false
        },
        plugins: [
            new webpack.optimize.MinChunkSizePlugin({minChunkSize: 10000}),
            AutoImport({
                resolvers: [
                    ElementPlusResolver()
                ]
            }),
            Components({
                resolvers: [
                    ElementPlusResolver()
                ]
            }),
        ]
    },

    publicPath: process.env.NODE_ENV === 'production' ? '/' : '/',
    outputDir: '../network/dist',
    crossorigin: "anonymous",
    devServer: {
        proxy: 'http://localhost:9001/',
        allowedHosts: ['127.0.0.1:9001'],
        port: 8888,
    }
})
